<template>
    <div style="width:100vw;height:100vh">
        <div id="main" style="width: 70%;height:80%;"></div>
    </div>
</template>

<script>
export default {
    data() {
        return {

        };
    },
    computed: {

    },
    created() {

    },
    mounted() {
        var myChart = this.$myEcharts('main')

        // 指定图表的配置项和数据
        var option = {
            title: {
                text: 'ECharts 入门示例'
            },
            tooltip: {},
            legend: {
                data: ['one', 'two', 'three', 'four', 'five']
            },
            xAxis: {
                type: 'category',
                name: 'x轴',
                data: ['衬衫', '羊毛衫', '雪纺衫', '裤子', '高跟鞋', '袜子'],
                nameTextStyle: { color: 'blue', fontSize: 20, align: 'center' },
                nameGap: 25,
                nameLocation: 'center',
            },
            yAxis: {
                axisLine: {
                    show: true, symbol: 'arrow', symbolSize: [5, 8], symbolOffset: [-5, 10], lineStyle: {
                        color: '#000', type: 'solid',
                    },

                },
                axisTick: { show: true, inside: true },
                axisLabel: { show: true, formatter: '{value} kg' },
                name: 'y轴',
                nameLocation: 'center',
                nameTextStyle: { color: 'blue', fontSize: 20, align: 'center' },
                nameGap: 38,
            },
            dataset: {
                source: [
                    ['product', 'one', 'two', 'three', 'four', 'five'],
                    ['衬衫', 15, 8, 24, 26, 30],
                    ['羊毛衫', 15, 8, 24, 26, 30],
                    ['雪纺衫', 15, 8, 24, 26, 30],
                    ['裤子', 15, 8, 24, 26, 30],
                    ['高跟鞋', 15, 8, 24, 26, 30],
                    ['袜子', 15, 8, 24, 26, 30]
                ]
            },
            series: [{ type: 'bar' }, { type: 'bar' }, { type: 'bar' }, { type: 'bar' }, { type: 'bar' }, { type: 'bar' },]
        };

        // 使用刚指定的配置项和数据显示图表。
        myChart.setOption(option);

        window.onresize = function () {
            myChart.resize();
        };
    },
    watch: {

    },
    methods: {

    },
    components: {

    },
};
</script>

<style scoped>
</style>
